<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>用户中心</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <meta name="keywords" content="">
  <meta name="description" content="">
  {include file="public/css"}
</head>
<body>

<!-- 头部开始 -->
{include file="public/header"}
<!-- 头部结束 -->

<div class="layui-main fly-marginTop fly-user-main ">

<div class="user-left-menu" style=""> 

<!-- 用户中心导航菜单 -->
{include file="public/left_menu"}
</div>
        <div class="fly-panel fly-panel-user user-right-content" pad20>

        <div class="layui-tab layui-tab-brief" lay-filter="user">
            <ul class="layui-tab-title" id="LAY_mine">
                <li   class="layui-this"><a href="{:url('finance/withdraw')}">我要提现</a></li>
                <li  ><a href="{:url('finance/withdrawRecord')}">提现记录</a></li>        
     
            </ul>
            <div class="layui-tab-content" style="padding: 20px 0;">
            {if empty($Request.param.step) ||  $Request.param.step ==1 }
          <!-- 第一步输入安全密码 -->
          <blockquote class="layui-elem-quote">尊敬的用户，为了您的账号安全，在进行此操作前，请先输入安全密码</blockquote>
  
        <form class="layui-form" action="">

            <div class="layui-form-item">
              <label class="layui-form-label">支付密码</label>
              <div class="layui-input-inline">
                <input type="text" name="payword" required  lay-verify="required" placeholder="" autocomplete="off" class="layui-input">
              </div>
                  <div class="layui-form-mid layui-word-aux">个人初始支付密码为个人密码，请尽量修改。</div>
              
            </div>
             <div class="layui-form-item">
                      <div class="layui-input-block">
                        <button class="layui-btn layui-btn-normal" lay-submit lay-filter="form1">提交</button>
                     
                      </div>
              </div>
         </form>
         {elseif $Request.param.step ==2}



          <!-- 第二步骤 提现 -->
          {if  !empty($settings.finance.withdraw_min) || !empty($settings.finance.withdraw_max)}
            <blockquote class="layui-elem-quote">
            {if !empty($settings.finance.withdraw_min) >0}单日提现最小金额:￥{:number_format($settings.finance.withdraw_min,2)}元。{/if}

             {if !empty($settings.finance.withdraw_max) >0}单日提现最大金额:￥{:number_format($settings.finance.withdraw_max,2)}元。{/if}
            </blockquote>
          {/if}
             <form class="layui-form" action="">
                {:token()}
                  <div class="layui-form-item">
                    <label class="layui-form-label">我的余额：</label>
                    <div class="layui-input-block">
                       <div class="layui-form-mid layui-word-aux "><span class="orange">￥ {$user.money}元</span></div>
                    </div>
                  </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">提现方式：</label>
                    <div class="layui-input-inline" style="width:300px">
                          <select name="bank_type" lay-verify="required">
                          {volist name="list" id="vo"}
                            <option value="{$vo.id}">{$vo.bankname}- {$vo.realname} -{$vo.card_number}</option>
                          {/volist}
                          </select>
                    </div>
                    
                  </div>
                  {if  is_numeric($settings.finance.withdraw_fee) && $settings.finance.withdraw_fee > 0}  
                <div class="layui-form-item">
                    <label class="layui-form-label">手续费：</label>
                    <div class="layui-input-inline">
                          <div class="layui-form-mid layui-word-aux">{$settings.finance.withdraw_fee}%</div>
                    </div>
                      <div class="layui-input-inline">
              
                    </div>
                  </div>
                 {/if}

                  <div class="layui-form-item">
                    <label class="layui-form-label">提现金额：</label>
                    <div class="layui-input-inline">
                      <input type="text" name="amount"  placeholder="请输入提现金额" autocomplete="off" class="layui-input"> 
                    </div>
                      <div class="layui-input-inline">
                    <div class="layui-form-mid layui-word-aux">元</div>
                    </div>
                  </div>
                

                  <div class="layui-form-item">
                    <div class="layui-input-block">
                      <button class="layui-btn layui-btn-normal" lay-submit lay-filter="form2">确定</button>
                   
                    </div>
                  </div>
                  </form>
        {/if}
           </div>



           </div>
           </div>
        </div>
        </div>
    
</div>
{include file="public/js"}
<!-- 会员底部文件 -->
{include file="public/footer"}



<script>

layui.use(['form','table','laypage','laydate'], function(){
  var form = layui.form;


 //监听提交
  form.on('submit(form1)', function(data){
    $.post("{:url('finance/withdraw',['step'=>1])}",$("form").serialize(),function(json){
          if(json.code == 0){
            layer.msg(json.msg);
            location.href= "{:url('finance/withdraw',['step' =>2])}";
          }else{
            layer.msg(json.msg);
          }
    });
    return false; //阻止表单跳转
  });

 //监听提交
  form.on('submit(form2)', function(data){
    $.post("{:url('finance/withdraw',['step'=>2])}",$("form").serialize(),function(json){
          if(json.code == 0){
            qilecms.success(json.msg);
            location.reload();
          }else{
            qilecms.error(json.msg);
          }
    });
    return false; //阻止表单跳转
  });

});
</script>

</body>
</html>